package com.tinghua.mqTest.deal;

import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Delivery;
import com.tinghua.mqTest.utils.ConnectionMQ;

import java.util.HashMap;
import java.util.Map;

public class ConsumerDeal {
    public static void main(String[] args) throws Exception{
        Channel channel = ConnectionMQ.utilConnectionMQ();

        //队列Q1接收消息
        channel.basicConsume("Q2", true, (String consumerTag, Delivery message) -> {
            System.out.println("Q2处理消息... " + new String(message.getBody()));
        }, consumerTag -> {});
    }
}
